-
Notifications
You must be signed in to change notification settings - Fork 52
feat: simple aggregator discovery #2779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a simple aggregator discovery mechanism to enable the Mithril client to automatically discover and connect to available aggregators in a network.
Key changes:
- Introduces a new
mithril-aggregator-discoverycrate with discoverer implementations - Refactors the
ClientBuilderAPI to support aggregator discovery modes (automatic vs. explicit URL) - Adds capability-based filtering and randomization of aggregator selection
Reviewed Changes
Copilot reviewed 18 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
internal/mithril-aggregator-discovery/Cargo.toml |
Defines the new aggregator discovery crate with dependencies |
internal/mithril-aggregator-discovery/src/lib.rs |
Exports the public API for aggregator discovery |
internal/mithril-aggregator-discovery/src/interface.rs |
Defines the AggregatorDiscoverer trait |
internal/mithril-aggregator-discovery/src/model.rs |
Implements MithrilNetwork and AggregatorEndpoint models |
internal/mithril-aggregator-discovery/src/http_config_discoverer.rs |
HTTP-based discoverer that fetches aggregator lists from remote configuration |
internal/mithril-aggregator-discovery/src/capabilities_discoverer.rs |
Filters aggregators by required capabilities |
internal/mithril-aggregator-discovery/src/rand_discoverer.rs |
Shuffles aggregator order using randomization |
internal/mithril-aggregator-discovery/src/test/ |
Test utilities and doubles for testing |
mithril-client/src/client.rs |
Refactors client builder to support aggregator discovery |
mithril-client/Cargo.toml |
Adds dependency on the new discovery crate |
Makefile, Cargo.toml, .github/workflows/ci.yml |
Build configuration updates |
README.md |
Documentation for the new crate |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/mithril-aggregator-discovery/src/test/double/discoverer.rs
Outdated
Show resolved
Hide resolved
945d3c2 to
c74fb50
Compare
c74fb50 to
434891f
Compare
434891f to
c9f8423
Compare
c9f8423 to
8101ed2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 23 out of 25 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/mithril-aggregator-discovery/src/capabilities_discoverer.rs
Outdated
Show resolved
Hide resolved
8101ed2 to
4a5ec0d
Compare
Implementation for 'AggregatorDiscoverer' trait.
…ementation of 'Iterator' trait
…ities' type Which allows to combine signed entity types and aggregate signature type in a flexible way.
4a5ec0d to
bbb18cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 31 out of 33 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/mithril-aggregator-discovery/src/http_config_discoverer.rs
Outdated
Show resolved
Hide resolved
internal/mithril-aggregator-discovery/src/http_config_discoverer.rs
Outdated
Show resolved
Hide resolved
bbb18cb to
9a0ab5a
Compare
Content
This PR introduces a simple Aggregator Discovery functionality to the Mithril client library and CLI, allowing clients to automatically discover and connect to suitable aggregators based on their capabilities rather than requiring a hardcoded aggregator endpoint:
New
mithril-aggregator-discoverycrateA standalone crate providing aggregator discovery functionality:
AggregatorDiscoverertrait for extensible discovery mechanismsHttpConfigAggregatorDiscovererfor fetching aggregator lists from HTTP endpointsShuffleAggregatorDiscovererdecorator for randomizing aggregator selectionCapableAggregatorDiscovererdecorator for filtering aggregators by required capabilitiesMithrilNetworktype tomithril-commonfor shared usageRequiredAggregatorCapabilitiestype for cleaner capability filteringClient integration
aggregator_discoverer()method in client builder as the recommended way to configure aggregatorsaggregator()constructor in favor ofnewconstructor####CLI enhancements
tools aggregator-discoverycommand (unstable) to list available aggregators--jsonflagPre-submit checklist
Issue(s)
Closes #2726